home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / toolkit / vbof_v11 / vboflbox.cls < prev    next >
Text File  |  1996-03-03  |  20KB  |  724 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = 0   'False
  4. END
  5. Attribute VB_Name = "VBOFListBoxWrapper"
  6. Attribute VB_Creatable = True
  7. Attribute VB_Exposed = True
  8. Option Explicit
  9.  
  10. ' (c) Copyright 1995 Ken Fitzpatrick
  11. '     All Rights Reserved
  12. '     Cannot be distributed or sold without permission
  13. '
  14. ' VBOFListBoxWrapper is a supplemental GUI Control
  15. '   Wrapper for Microsoft Visual Basic 4.0.
  16. '   It is valid only in conjunction with the
  17. '   following Classes Modules:
  18. '       VBOFCollection
  19. '       VBOFObjectLink
  20. '       VBOFObjectManager
  21.  
  22. ' VBOFListBoxWrapper is a wrapper class for
  23. '   providing automatic interfacing between a
  24. '   ListBox VB control and an underlying
  25. '   VBOFCollection
  26.  
  27. Private pvtVBOFObjectManager As VBOFObjectManager
  28. Private pvtCollection As VBOFCollection
  29. Private pvtListBox As Variant
  30. Private pvtSupportedTypeNames As String
  31.  
  32. Public ObjectID As Long
  33.  
  34. Public Function Sort( _
  35.     Optional SortField As Variant, _
  36.     Optional SortOrder As Variant) As Boolean
  37. ' Sorts the objects in the underlying
  38. '   VBOFCollection according to the field
  39. '   referenced in SortField:= and the sort
  40. '   order referenced in SortOrder:=
  41. ' For additional information, see the VBOF User's
  42. '   Guide
  43. ' Programming example:
  44. '   MyWrapper.Sort _
  45. '       SortField:="FirstName", _
  46. '       SortOrder:="ASC"
  47.         
  48.     Sort = _
  49.         ObjectManager.pvtWrapperSort( _
  50.             Wrapper:=Me, _
  51.             SortField:=SortField, _
  52.             SortOrder:=SortOrder)
  53. End Function
  54.  
  55.  
  56. Public Function Unbind() As Boolean
  57.  
  58.     Set pvtCollection = Nothing
  59.     Set pvtListBox = Nothing
  60.     Set pvtVBOFObjectManager = Nothing
  61.  
  62. End Function
  63.  
  64.  
  65. Public Function Rebind( _
  66.     Optional Collection As Variant, _
  67.     Optional ListBox As Variant) As Boolean
  68. ' Rebinds the Wrapper to a Collection or ListBox
  69. '   after having changed the assignment of either.
  70. '   For example, in the following scenario, the
  71. '   VBOFDBGridWrapper must be rebound because the
  72. '   VBOFCollection has been significantly altered:
  73. '
  74. '   Dim pvtAddresses as VBOFCollection
  75. '   Dim pvtPerson as Person
  76. '   Dim MyListBoxWrapper as VBOFListBoxWrapper
  77. '   Set MyListBoxWrapper = _
  78. '       ObjectManager.NewVBOFListBoxWrapper ( _
  79. '           Collection:=pvtAddresses, _
  80. '           ListBox:=MyListBox)
  81. '
  82. ' the following line alters the state of the data
  83. ' in-effect at the time of the above binding
  84. '   Set pvtAddresses = pvtPerson.Addresses
  85. ' rebind the Wrapper
  86. '   MyListBoxWrapper.Rebind _
  87. '           Collection:=pvtAddresses
  88.     
  89. ' bullet-proofing
  90.     If Not IsMissing(Collection) Then
  91.         If TypeName(Collection) <> _
  92.             "VBOFCollection" _
  93.         Then
  94.             pvtErrorMessage TypeName(Me) & " cannot process the '.Rebind' method because the 'Collection:=' parameter is not a VBOFCollection."
  95.             Rebind = False
  96.             Exit Function
  97.         End If
  98.     End If
  99.     If Not IsMissing(ListBox) Then
  100.         If TypeName(ListBox) <> "ListBox" _
  101.         And TypeName(ListBox) <> "ComboBox" _
  102.         Then
  103.             pvtErrorMessage TypeName(Me) & " cannot process the '.Rebind' method because the 'ListBox:=' parameter is not a Visual Basic ListBox control.  Please use a VBOF Wrapper for the " & TypeName(ListBox) & " control (or request the development of one.)"
  104.             Rebind = False
  105.             Exit Function
  106.         End If
  107.     End If
  108.     If Not pvtIsFullyInitialized( _
  109.         Collection:=Collection, _
  110.         ListBox:=ListBox, _
  111.         Verbose:=False) _
  112.     Then
  113.         Exit Function
  114.     End If
  115.     
  116. ' bind to the ListBox and Collection
  117.     If Not IsMissing(Collection) Then
  118.         If Not Collection Is Nothing Then
  119.             Set Me.Collection = _
  120.                 Collection
  121.         End If
  122.     End If
  123.     
  124.     If Not IsMissing(ListBox) Then
  125.         If Not ListBox Is Nothing Then
  126.             Set Me.ListBox = _
  127.                 ListBox
  128.         End If
  129.     End If
  130.  
  131.     Rebind = True
  132. End Function
  133.  
  134.  
  135. Public Function AddItems( _
  136.     Optional ListBox As Variant, _
  137.     Optional Clear As Variant) As Boolean
  138. ' Populates the ListBox with one line of information
  139. '   for each object in this VBOFListBoxWrapper
  140. ' Note:  the referenced objects must contain the
  141. '   method 'ObjectListBoxValue', which must return
  142. '   a String which is the text which is to appear
  143. '   in the ListBox and is to represent the object
  144. '   for the purposes of the ListBox.
  145. ' Note:  this method should be coded as follows:
  146. '    MyVBFWListBoxWrapper.AddItems MyListBox
  147. '   (although 'MyListBox' is optional)
  148.     
  149.     On Local Error Resume Next
  150.     
  151. ' bullet-proofing
  152.     If Not pvtIsFullyInitialized _
  153.         (ListBox:=ListBox) _
  154.     Then
  155.         Exit Function
  156.     End If
  157.     
  158. ' support pre-Clearing
  159.     If Not IsMissing(Clear) Then
  160.         If Clear Then
  161.             Me.Clear
  162.         End If
  163.     End If
  164.     
  165.     AddItems = _
  166.         pvtCollection. _
  167.             pvtListBoxAddItems _
  168.                 (ListBox:=pvtListBox)
  169.         
  170. End Function
  171.  
  172. Public Function Clear( _
  173.     Optional ListBox As Variant, _
  174.     Optional FreeObjects As Variant) As Boolean
  175. ' Empties the objects from the ListBox and removes
  176. '   the corresponding objects from the Collection
  177. ' Note:  this method should be coded as follows:
  178. '     MyVBFWListBoxWrapper.Clear _
  179. '               MyListBox
  180. '   (although 'MyListBox' is optional)
  181.     
  182.     On Local Error Resume Next
  183.  
  184. ' bullet-proofing
  185.     If Not pvtIsFullyInitialized _
  186.         (ListBox:=ListBox) _
  187.     Then
  188.         Exit Function
  189.     End If
  190.  
  191.     Clear = _
  192.         pvtCollection. _
  193.             pvtListBoxClear _
  194.                 (ListBox:=pvtListBox)
  195. End Function
  196.  
  197. Public Property Get ListBox() As Variant
  198. Attribute ListBox.VB_Description = "Sets the underlying ListBox"
  199.     Set ListBox = pvtListBox
  200. End Property
  201.  
  202. Public Property Get ListCount() As Long
  203. ' Returns the ListBox's ListCount property
  204. ' Note:  this method should be used as follows:
  205. '       MyListCount = _
  206. '           MyVBFWListBoxWrapper.ListCount
  207.     
  208.     On Local Error Resume Next
  209.  
  210.     ListCount = _
  211.         pvtCollection. _
  212.             pvtListBoxListCount _
  213.                 (ListBox:=pvtListBox)
  214.  
  215. End Property
  216.  
  217. Public Property Get ListIndex() As Long
  218. Attribute ListIndex.VB_Description = "Sets the ListIndex property of the underlying ListBox"
  219. ' Returnss the ListBox's ListIndex
  220. ' Note:  this method should be used as follows:
  221. '   MyListIndex = _
  222. '       MyVBFWListBoxWrapper.ListIndex
  223.     
  224.     On Local Error Resume Next
  225.  
  226. ' bullet-proofing
  227.     If Not pvtIsFullyInitialized() _
  228.     Then
  229.         Exit Property
  230.     End If
  231.  
  232.     ListIndex = _
  233.         pvtCollection. _
  234.             pvtListBoxListIndex _
  235.                 (pvtListBox)
  236.  
  237. End Property
  238.  
  239. Public Property Let ListIndex(ListIndex As Long)
  240. ' Sets the ListBox's ListIndex
  241. ' Note:  this method should be used as follows:
  242. '   MyVBFWListBoxWrapper.ListIndex = _
  243. '       MyListIndex
  244.     
  245.     On Local Error Resume Next
  246.     
  247. ' bullet-proofing
  248.     If Not pvtIsFullyInitialized() _
  249.     Then
  250.         Exit Property
  251.     End If
  252.  
  253.     pvtCollection. _
  254.         pvtListBoxListIndex _
  255.             (pvtListBox) = _
  256.                 ListIndex
  257.  
  258. End Property
  259.  
  260. Public Property Get ListIndexObject() As Variant
  261. Attribute ListIndexObject.VB_Description = "Sets the ListIndex property of the underlying ListBox according to the object"
  262. ' Returns the object at the ListBox's ListIndex
  263. ' Note:  this method should be coded as follows:
  264. '   Dim MyObject as MyObject
  265. '   Set MyObject = _
  266. '       MyVBFWListBoxWrapper.ListIndexObject
  267.     
  268.     On Local Error Resume Next
  269.  
  270. ' bullet-proofing
  271.     If Not pvtIsFullyInitialized() _
  272.     Then
  273.         Exit Property
  274.     End If
  275.  
  276.     Set ListIndexObject = _
  277.         pvtCollection. _
  278.             pvtListBoxListIndexObject _
  279.                 (pvtListBox)
  280. End Property
  281.  
  282.  
  283. Public Property Set ListIndexObject(Object As Variant)
  284. ' Sets the ListBox's ListIndex to correspond to the
  285. '   Object and returns the selected Object
  286. ' Note:  this method should be coded as follows:
  287. '   Dim MyObject as MyObject
  288. '   MyVBFWListBoxWrapper.ListIndexObject = _
  289. '           MyObject
  290.     
  291.     On Local Error Resume Next
  292.  
  293. ' bullet-proofing
  294.     If Not pvtIsFullyInitialized() _
  295.     Then
  296.         Exit Property
  297.     End If
  298.  
  299.     Set pvtCollection. _
  300.         pvtListBoxListIndexObject _
  301.             (pvtListBox) = _
  302.                 Object
  303.  
  304. End Property
  305.  
  306. Public Function Refresh( _
  307.     Optional ListBox As Variant, _
  308.     Optional DisplayOnly As Variant) As Boolean
  309. ' Refreshes the display of the ListBox
  310. ' Note:  this method should be coded as follows:
  311. '   MyVBFWListBoxWrapper.Refresh
  312.     
  313.     On Local Error Resume Next
  314.  
  315. ' bullet-proofing
  316.     If Not pvtIsFullyInitialized _
  317.         (ListBox:=ListBox) _
  318.     Then
  319.         Exit Function
  320.     End If
  321.  
  322.     Refresh = _
  323.         pvtCollection. _
  324.             pvtListBoxRefresh _
  325.                 (ListBox:=pvtListBox)
  326. End Function
  327.  
  328. Public Function RemoveItem( _
  329.     Optional ListBox As Variant, _
  330.     Optional ListIndex As Variant) As Boolean
  331. ' Removes the Object at the specified ListIndex
  332. '   from the ListBox
  333. ' Note:  this method should be coded as follows:
  334. '   Dim MyUndesiredListIndex As Long
  335. '   MyVBFWListBoxWrapper.RemoveItem _
  336. '      ListIndex:=MyUndesiredListIndex
  337.     
  338.     On Local Error Resume Next
  339.  
  340. ' bullet-proofing
  341.     If Not pvtIsFullyInitialized _
  342.         (ListBox:=ListBox) _
  343.     Then
  344.         Exit Function
  345.     End If
  346.  
  347.     RemoveItem = _
  348.         pvtCollection. _
  349.             pvtListBoxRemoveItem( _
  350.                 ListBox:=pvtListBox, _
  351.                 ListIndex:=ListIndex)
  352.  
  353. End Function
  354.  
  355. Public Function RemoveObject(Optional ListBox As Variant, Optional Object As Variant) As Boolean
  356. Attribute RemoveObject.VB_Description = "Removes the Object from the ListBox and the underlying VBOFCollection"
  357. ' Removes the specified Object from the ListBox
  358. ' Note:  this method should be coded as follows:
  359. '   Dim MyUndesiredObject As MyClass
  360. '   MyVBFWListBoxWrapper.RemoveObject _
  361. '      Object:=MyUndesiredObject
  362.     
  363.     On Local Error Resume Next
  364.  
  365. ' bullet-proofing
  366.     If Not pvtIsFullyInitialized _
  367.         (ListBox:=ListBox) _
  368.     Then
  369.         Exit Function
  370.     End If
  371.  
  372.     RemoveObject = _
  373.         pvtCollection. _
  374.             pvtListBoxRemoveObject( _
  375.                 ListBox:=pvtListBox, _
  376.                 Object:=Object)
  377.  
  378. End Function
  379.  
  380. Public Property Get SelectedObjects() As Collection
  381. Attribute SelectedObjects.VB_Description = "Returns a VB Collection containing the objects equating to the items in the ListBox which are selected"
  382. ' Returns a collection of the selected objects
  383. '   of the specified ListBox
  384. ' Note:  this method should be coded as follows:
  385. '   Dim MyCollection As Collection
  386. '   Set MyCollection = _
  387. '       MyVBFWListBoxWrapper.SelectedObjects
  388.     
  389.     On Local Error Resume Next
  390.  
  391. ' bullet-proofing
  392.     If Not pvtIsFullyInitialized() _
  393.     Then
  394.         Exit Property
  395.     End If
  396.  
  397.     Set SelectedObjects = _
  398.         pvtCollection. _
  399.             pvtListBoxSelectedObjects _
  400.                 (pvtListBox)
  401.             
  402. End Property
  403.  
  404. Public Property Set SelectedObjects(Collection As Collection)
  405. ' Sets the selected objects of the specified
  406. '   ListBox to the contents of Collection
  407. ' Note:  this method should be coded as follows:
  408. '   Dim MyCollection As Collection
  409. '   Set MyVBFWListBoxWrapper.SelectedObjects = _
  410. '       MyCollection
  411.     
  412.     On Local Error Resume Next
  413.  
  414. ' bullet-proofing
  415.     If Not pvtIsFullyInitialized() _
  416.     Then
  417.         Exit Property
  418.     End If
  419.  
  420.     Set pvtCollection. _
  421.         pvtListBoxSelectedObjects _
  422.             (pvtListBox) = _
  423.                 Collection
  424.         
  425. End Property
  426.  
  427. Public Property Get SelectObject() As Variant
  428. Attribute SelectObject.VB_Description = "Returns the object which is currently selected in the ListBox"
  429. ' Returns the selected object from the ListBox
  430. ' Note:  this method should be coded as follows:
  431. '   Dim MyDesiredObject As MyClass
  432. '   Set MyDesiredObject = _
  433. '       MyVBFWListBoxWrapper.SelectObject
  434.     
  435.     On Local Error Resume Next
  436.  
  437. ' bullet-proofing
  438.     If Not pvtIsFullyInitialized() _
  439.     Then
  440.         Exit Property
  441.     End If
  442.  
  443.     Set SelectObject = _
  444.         pvtCollection. _
  445.             pvtListBoxSelectObject _
  446.                 (pvtListBox)
  447.             
  448. End Property
  449.  
  450. Public Property Set SelectObject(Object As Variant)
  451. ' Selects the specified Object from the ListBox
  452. ' Note:  this method should be coded as follows:
  453. '   Dim MyDesiredObject As MyClass
  454. '   Set MyVBFWListBoxWrapper.SelectObject = _
  455. '       MyDesiredObject
  456.     
  457.     On Local Error Resume Next
  458.  
  459. ' bullet-proofing
  460.     If Not pvtIsFullyInitialized() _
  461.     Then
  462.         Exit Property
  463.     End If
  464.  
  465.     Set pvtCollection. _
  466.         pvtListBoxSelectObject _
  467.             (pvtListBox) = _
  468.                 Object
  469.  
  470. End Property
  471.  
  472. Public Property Get TopIndex() As Long
  473. Attribute TopIndex.VB_Description = "Maps to the ListBox.TopIndex property"
  474. ' Returns the ListBox's TopIndex property
  475. ' Note:  this method should be used as follows:
  476. '   MyTopIndex = _
  477. '       MyVBFWListBoxWrapper.TopIndex
  478.     
  479.     On Local Error Resume Next
  480.  
  481. ' bullet-proofing
  482.     If Not pvtIsFullyInitialized() _
  483.     Then
  484.         Exit Property
  485.     End If
  486.  
  487.     TopIndex = _
  488.         pvtCollection. _
  489.             pvtListBoxTopIndex _
  490.                 (pvtListBox)
  491.  
  492. End Property
  493.  
  494. Public Property Get Text() As String
  495. Attribute Text.VB_Description = "Retuens the Text property of the ComboBox"
  496. ' Returns the ComboBox's Text property
  497. ' Note:  this method should be used as follows:
  498. '   MyString = _
  499. '       MyVBFWListBoxWrapper.Text
  500.     
  501.     On Local Error Resume Next
  502.  
  503. ' bullet-proofing
  504.     If Not pvtIsFullyInitialized() _
  505.     Then
  506.         Exit Property
  507.     End If
  508.  
  509.     Text = _
  510.         pvtCollection. _
  511.             pvtComboBoxText _
  512.                 (pvtListBox)
  513.  
  514. End Property
  515. Public Property Let Text(aString As String)
  516. ' Sets the ComboBox's Text property to aString
  517. ' Note:  this method should be used as follows:
  518. '    MyVBFWListBoxWrapper.Text = _
  519. '        MyString
  520.     
  521.     On Local Error Resume Next
  522.  
  523. ' bullet-proofing
  524.     If Not pvtIsFullyInitialized() _
  525.     Then
  526.         Exit Property
  527.     End If
  528.  
  529.     pvtCollection. _
  530.         pvtComboBoxText _
  531.             (pvtListBox) = _
  532.                 aString
  533. End Property
  534.  
  535.  
  536. Public Property Let TopIndex(aLong As Long)
  537. ' Sets the ListBox's TopIndex property to aLong
  538. ' Note:  this method should be used as follows:
  539. '    MyVBFWListBoxWrapper.TopIndex = _
  540. '        MyTopIndex
  541.     
  542.     On Local Error Resume Next
  543.  
  544. ' bullet-proofing
  545.     If Not pvtIsFullyInitialized() _
  546.     Then
  547.         Exit Property
  548.     End If
  549.  
  550.     pvtCollection. _
  551.         pvtListBoxTopIndex _
  552.             (pvtListBox) = _
  553.                 aLong
  554.  
  555. End Property
  556.  
  557. Public Property Get TopObject() As Variant
  558. Attribute TopObject.VB_Description = "Maps to the object which occupies the ListBox.TopIndex property"
  559. ' Returns the Object at the ListBox's TopIndex property
  560. ' Note:  this method should be used as follows:
  561. '   Set MyTopObject = _
  562. '       MyVBFWListBoxWrapper.pvtListBoxTopObject
  563.     
  564.     On Local Error Resume Next
  565.  
  566. ' bullet-proofing
  567.     If Not pvtIsFullyInitialized() _
  568.     Then
  569.         Exit Property
  570.     End If
  571.  
  572.     Set TopObject = _
  573.         pvtCollection. _
  574.             pvtListBoxTopObject _
  575.                 (ListBox:=pvtListBox)
  576.  
  577. End Property
  578.  
  579. Public Property Set TopObject(Object As Variant)
  580. ' Sets the ListBox's TopIndex property to the
  581. '   position of Object
  582. ' Note:  this method should be used as follows:
  583. '   Set MyVBFWListBoxWrapper.TopObject = _
  584. '       MyTopObject
  585.     
  586.     On Local Error Resume Next
  587.  
  588. ' bullet-proofing
  589.     If Not pvtIsFullyInitialized() _
  590.     Then
  591.         Exit Property
  592.     End If
  593.  
  594.     pvtCollection. _
  595.         pvtListBoxTopObject _
  596.             (pvtListBox) = _
  597.                 Object
  598. End Property
  599.  
  600.  
  601. Public Property Get ObjectManager() As VBOFObjectManager
  602. ' Return my reference to the VBOFObjectManager
  603.     
  604.     Set ObjectManager = pvtVBOFObjectManager
  605. End Property
  606.  
  607. Public Property Set ObjectManager(anObjectManager As VBOFObjectManager)
  608. ' Set my reference to the VBOFObjectManager
  609.     
  610.     Set pvtVBOFObjectManager = anObjectManager
  611. End Property
  612.  
  613. Public Property Set Collection(Collection As Variant)
  614. Attribute Collection.VB_Description = "Sets the underlying VBOFCollection"
  615.     
  616.     If Collection Is Nothing Then
  617.         Set pvtCollection = Nothing
  618.         Exit Property
  619.     End If
  620.     
  621.     pvtVerifyCollection _
  622.         Collection:=Collection, _
  623.         Verbose:=True
  624. End Property
  625.  
  626. Public Property Get Collection() As Variant
  627. ' Returns my VBOFCollection object
  628.  
  629.     Set Collection = pvtCollection
  630. End Property
  631.  
  632.  
  633. Public Property Set ListBox(ListBox As Variant)
  634.     pvtVerifyListBox _
  635.         ListBox:=ListBox
  636. End Property
  637.  
  638. Private Function pvtVerifyListBox(Optional ListBox As Variant, Optional Verbose As Variant) As Boolean
  639.     pvtVerifyListBox = _
  640.         ObjectManager. _
  641.             pvtWrapperVerifyControl( _
  642.                 Control:=ListBox, _
  643.                 pvtControl:=pvtListBox, _
  644.                 Verbose:=Verbose)
  645. End Function
  646.  
  647. Private Function pvtUseListBox(Optional ListBoxParm As Variant, Optional Verbose As Variant) As Variant
  648.     Set pvtUseListBox = _
  649.         ObjectManager. _
  650.             pvtWrapperUseControl( _
  651.                 ControlParm:=ListBoxParm, _
  652.                 pvtControl:=pvtListBox, _
  653.                 SupportedNames:=pvtSupportedTypeNames, _
  654.                 Verbose:=Verbose, _
  655.                 WrapperName:="ListBox")
  656. End Function
  657.  
  658. Private Function pvtErrorMessage(Optional ErrorMessage As Variant) As Long
  659.     pvtErrorMessage = _
  660.         pvtVBOFObjectManager.DisplayErrorMessage _
  661.             (ErrorMessage)
  662. End Function
  663.  
  664. Private Function pvtIsFullyInitialized(Optional Collection As Variant, Optional ListBox As Variant, Optional Verbose As Variant) As Boolean
  665.     
  666.     If Not pvtVerifyCollection( _
  667.         Collection:=Collection, _
  668.         Verbose:=Verbose) _
  669.     Then
  670.         pvtIsFullyInitialized = False
  671.         Exit Function
  672.     End If
  673.     
  674.     If Not pvtVerifyListBox( _
  675.         ListBox:=ListBox, _
  676.         Verbose:=Verbose) _
  677.     Then
  678.         pvtIsFullyInitialized = False
  679.         Exit Function
  680.     End If
  681.  
  682.     pvtIsFullyInitialized = True
  683. End Function
  684.  
  685. Private Function pvtUseCollection(Optional CollectionParm As Variant, Optional Verbose As Variant) As Variant
  686.     Set pvtUseCollection = _
  687.         ObjectManager. _
  688.             pvtWrapperUseCollection( _
  689.                 CollectionParm:=CollectionParm, _
  690.                 pvtCollection:=pvtCollection, _
  691.                 Verbose:=Verbose, _
  692.                 WrapperName:="ListBox")
  693. End Function
  694.  
  695.  
  696. Private Function pvtVerifyCollection(Optional Collection As Variant, Optional Verbose As Variant) As Boolean
  697.     pvtVerifyCollection = _
  698.         ObjectManager. _
  699.             pvtWrapperVerifyCollection( _
  700.                 Collection:=Collection, _
  701.                 pvtCollection:=pvtCollection, _
  702.                 Verbose:=Verbose, _
  703.                 WrapperName:="ListBox")
  704. End Function
  705.  
  706.  
  707. Private Sub Class_Initialize()
  708.     pvtSupportedTypeNames = "ListBox ComboBox"
  709. End Sub
  710.  
  711. Private Sub Class_Terminate()
  712.     If Not ObjectManager Is Nothing Then
  713.     
  714. ' unregister the wrapper from the Form
  715. '       ObjectManager.pvtUnRegisterWrapperUnderForm _
  716.             Form:=Me.Form, _
  717.             Wrapper:=Me
  718.             
  719.         ObjectManager.TerminateObject _
  720.             Object:=Me
  721.     End If
  722. End Sub
  723.  
  724.